Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update allowing multiple locator pages #40

Merged
merged 1 commit into from
Oct 24, 2014

Conversation

muskie9
Copy link
Member

@muskie9 muskie9 commented Oct 20, 2014

@jirish this is what I was thinking for supporting multiple Locator pages on a single site. There is one area that needs some work (onBeforeDelete). Ideally it would trigger on the deletion of the draft page not on un-publish which is what happens.

If this looks good other than the onBeforeDelete I'll update the README and update the PR to include notes on the usage. This will probably constitute a new tag as it changes the get functions for the locations.

@jsirish
Copy link
Member

jsirish commented Oct 21, 2014

This looks OK to me.

Can we add a check so that, if there's only one locator, it automatically adds that relation? Keeps it simple if you're only using 1 locator on the site, but still allows the flexibility to use more than 1.

Let me know what you think.

@muskie9
Copy link
Member Author

muskie9 commented Oct 24, 2014

@jirish I'll update per your note. I think that will keep it a bit easier to maintain.

One thought for the multiple locator pages, will that affect the API call at all? We'll probably need to add (require) a get var in the url (i.e. http://yoursite.com/locator-page/xml?locatorID=2) as the updated xml() function tries to get locations based on locator ID if there are multiple pages.
https://github.com/dynamic/SilverStripe-Locator-Module/pull/40/files#diff-9a64a73b295df8eba4aefe63d9ef982dR164

I'll update the README to reflect this feature is needed.

@jsirish
Copy link
Member

jsirish commented Oct 24, 2014

re: API call - probably not, unless we're just pulling a subset of locations based on a single locator. It shouldn't effect the Sheep Finder, for example

@muskie9
Copy link
Member Author

muskie9 commented Oct 24, 2014

That's kind of what I'm thinking, if there are multiple locators the API can pull from an individual locator rather than the whole set. If there's no getter var specified it'll return the whole list:

https://gist.github.com/nhorstmeier/0a1a5349c528dc1c7af2#file-locator-php-L161

@muskie9 muskie9 force-pushed the MultiLocatorPages branch 2 times, most recently from f0ae9dd to b0a5052 Compare October 24, 2014 17:00
@muskie9
Copy link
Member Author

muskie9 commented Oct 24, 2014

I've updated the PR with the latest version. How do we want to handle locations that belonged to a locator that has been unpublished/deleted?

@jsirish
Copy link
Member

jsirish commented Oct 24, 2014

Not sure, should probably keep them (not delete) but indicate if they are orphaned somehow.

Also, we have that "show in locator" checkbox - do we need that anymore if you can choose which locator to display it in?

@muskie9
Copy link
Member Author

muskie9 commented Oct 24, 2014

I would keep the show in locator option as you may want to disable a location temporarily.

@jsirish
Copy link
Member

jsirish commented Oct 24, 2014

Yeah that makes sense

muskie9 added a commit that referenced this pull request Oct 24, 2014
Update allowing multiple locator pages
@muskie9 muskie9 merged commit 2374e57 into dynamic:master Oct 24, 2014
@muskie9 muskie9 deleted the MultiLocatorPages branch January 21, 2015 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants